/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package wat.ziszcommon.clientgui;
import javax.swing.tree.DefaultMutableTreeNode;

/**
 *
 * @author kubaolszewski
 */

public class MyFolder extends DefaultMutableTreeNode{
    private MyFolder rodzic;
    private String nazwa;
    private String myPath;
    private DefaultMutableTreeNode treeFolder;
    
    public MyFolder(MyFolder rodzic, String nazwa, MyJTree tree){
        this.rodzic=rodzic;
        this.nazwa=nazwa;
        if( rodzic == null){
            treeFolder = tree.addObject(null, this);
        }else{
            treeFolder = tree.addObject(rodzic.getTreeFolder(), this);
        } 
    }
    public void setMyPath(String myPath){
        this.myPath=myPath;
    }
    public String getFullPath(){
        return this.myPath+this.nazwa+"/";
    }
    public String getMyPath(){
        return this.myPath;
    }
    public MyFolder getRodzic(){
        return this.rodzic;
    }
    public DefaultMutableTreeNode getTreeFolder(){
        return this.treeFolder;
    }
    public String getNazwa(){
        return this.nazwa;
    }
    public String toString(){
        return this.getNazwa();
    }

}
